package kubeclient

import "time"

var K8sMap map[string]*KubeController

func SetUp() {
    K8sMap = make(map[string]*KubeController)
    configFile := ""
    kc := CreateKubeController(&configFile)
    K8sMap["k8s"] = kc
}

func CreateKubeController(configFile *string) *KubeController {
    stopPodCh := make(chan struct{})

    clientSet, kubeConfig := GetKubeClient(configFile)
    kc := NewKubeController(kubeConfig, clientSet, time.Second*3000)

    go func() {
        kc.Run(stopPodCh)
        <-stopPodCh
    }()
    return kc
}
